<script setup lang="ts">
import moment from "moment";
import { onMounted, ref } from "vue";

const tiem = ref();

const now = () => {
  tiem.value = new Date();
  return tiem.value;
};

const now1 = now();

const asd = [
  { name: "name1", time: now1, content: "2" },
  { name: "name2", time: now1, content: "2" },
  { name: "time", time: "2024-11-07T09:15:30Z", content: "2" },
  { name: "name4", time: "名字4", content: "2" },
  { name: "name5", time: "名字5", content: "2" },
  { name: "name6", time: "名字6", content: "2" },
];
asd.map((e) => {
  e.time = moment.utc(e.time).local().format("YYYY-MM-DD HH:mm:ss");
  //  moment(this.originalDate).format('YYYY-MM-DD HH:mm:ss')
});
console.log(asd);
const asds = [1,2,3,4,...asd]
console.log('拓展运算符', ...asds)
let qwe = [1,2,3]
const f = (x:any, y:any, z:any) => {
  return x + y + z
}

onMounted (() => {
  now();
})
</script>

<template>
    <el-table :data="asd" style="width: 100%">
      <el-table-column prop="name" label="Date" width="180" />
      <el-table-column prop="time" label="Name" width="180" />
      <el-table-column prop="content" label="Address" />
    </el-table>
</template>
